home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_oth / fifth21 / time.fiv < prev    next >
Text File  |  1986-03-29  |  1KB  |  37 lines

  1. CREATE X
  2. CREATE TIME
  3. EDIT
  4. \ Returns the time in hundreths of a second.
  5. 16 base !
  6. : time
  7. \ es  ds    si  di    dx  cx    bx  ax   int
  8.   00000000  00000000  00000000  00002C00 21  int       \ get time.
  9.   stack abcde|c                 \ get rid of bogusness
  10.   [ decimal ]
  11.   dup 16 shr swap 16 shl +      \ Yields time in hour.min.sec.100th
  12.   dup 255 and                                   \ Hundreths,
  13.   over  8 shr 255 and 100 * +                   \ Secs -> 100ths  and add,
  14.   over 16 shr 255 and 100 * 60 * +              \ Mins -> 100ths  and add,
  15.   swap 24 shr 255 and 100 * 60 * 60 * +         \ Hrs  -> 100ths  and add.
  16. ;
  17. ~UP
  18. CREATE TIME_PRINT
  19. EDIT
  20. \ Prints the time in the format >>--> Hours:minutes:seconds:100ths
  21. 16 base !
  22. : time_print
  23. \ es  ds    si  di    dx  cx    bx  ax   int
  24.   00000000  00000000  00000000  00002C00 21  int       \ get time.
  25.   stack abcde|c                                        \ get rid of bogusness
  26.   [ decimal ]
  27.   dup 16 shr swap 16 shl +
  28.   <# dup 255 and # # drop 8 shr 58 hold
  29.      dup 255 and # # drop 8 shr 58 hold
  30.      dup 255 and # # drop 8 shr 58 hold
  31.      dup 255 and # # drop 8 shr
  32.   #> type
  33. ;
  34. ~UP
  35. EDIT
  36. ~UP
  37. ABORT